Repository navigation
Conversation
…pt at or above a workspace folder
…t, skips a URI it can't read, and has its own test
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to solidjs#92.
In a workspace that hoists
node_modulesto a parent folder, Zed uses the server's bundled TypeScript unless you setsettings.typescript.tsdk. The extension can't look there, because Zed only lets an extension read inside the worktree.So the server does it, in the new
src/tsdk.js. When the client sends notsdk, it walks up from each workspace folder and uses the firstnode_modules/typescript/libit finds, stopping at the repository root (the folder with.git). If there's none, it uses its own TypeScript as before. A folder URI it can't turn into a path is skipped, so it can't stop the server from starting. I walk the folders by hand becauserequire.resolve(…, { paths })also searches global module folders, and could pick up a TypeScript installed on the machine.The extension still checks the worktree root itself, so nothing changes with the 0.3.1 server on npm. The parent lookup arrives with the next server release. VS Code always sends a
tsdk, so it's unaffected.test/tsdk.jscovers it on a temp tree and runs as part ofnpm test: 11 checks, including a hoisted install, one at the folder, an explicittsdk, a.gitfolder or file between the folder and a TypeScript above it,untitled:andfile://server/shareURIs, and emptyworkspaceFolders. All pass, and so doesnode test/run.js(16/16). I haven't tried it inside Zed yet.Based on
zed-rx, so the diff only shows this change.